/*
 * Copyright (c) 2006-2020, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-05-21     chenhy       the first version
 */
#ifndef APPLICATIONS_LFS_IF_H_
#define APPLICATIONS_LFS_IF_H_
#include <stdint.h>
#include "lfs_util.h"
#include "lfs.h"

lfs_file_t* file_open(const char *path, int flags);
int file_write(void *pbuf, int size, lfs_file_t *file);
int file_read(void *pbuf, int size, lfs_file_t *file);
int file_close(lfs_file_t *file);
int file_seek(lfs_file_t *file, int offset, int whence);
int file_tell(lfs_file_t *file);
void file_rewind(lfs_file_t *file);
int file_truncate(int size, lfs_file_t *file);
int file_remove(const char *path);
int file_rename(const char *oldpath, const char *newpath);
int file_getc(lfs_file_t *file);
char* file_gets(char *str, int n, lfs_file_t *file);
int file_putc(int data, lfs_file_t *file);
int file_puts(char *str, lfs_file_t *file);
lfs_dir_t* dir_open(const char *path);
int dir_close(lfs_dir_t *dir);
int dir_read(lfs_dir_t *dir, struct lfs_info *info);

int lfs_startup(void);
int lfs_df(void);
#endif /* APPLICATIONS_LFS_IF_H_ */
